#ifndef BIND_SL_MANAGER_HPP
#define BIND_SL_MANAGER_HPP

// std Header
#include <string>
#include <functional>

// SimpleRPG
#include <SimpleRPG/System.hpp>
#include <SimpleRPG/Manager.hpp>
#include <SimpleRPG/Window.hpp>

// Eigene Header
#include "../Lua.hpp"

namespace bind
{
	namespace SL
	{
		namespace manager
		{
			//template <class M> typedef sl::tmp::ManagerTemplate<M>* (sl::tmp::ManagerTemplate<M>::TemplateFkt)();
			//template <class M> typedef sl::tmp::ManagerPointer<M>* (sl::tmp::ManagerPointer<M>::PointerFkt)();
			void Bind(lua_State* lua, const std::string& ns);
			template <class M> void BSpecific(lua_State* lua, const std::string& ns, const std::string& name);//, std::tr1::function<sl::tmp::ManagerTemplate<M>* (sl::tmp::ManagerTemplate<M>*)> templatefkt);//(sl::tmp::ManagerTemplate<M>::*TemplateFkt)());//TemplateFkt fkt;);
			template <class M> void BPointer(lua_State* lua, const std::string& ns, const std::string& name);//, std::tr1::function<sl::tmp::ManagerPointer<M>* (sl::tmp::ManagerPointer<M>*)> pointerfkt);//PointerFkt fkt);
			void BScriptManager(lua_State* lua, const std::string& ns);
			void BImageManager(lua_State* lua, const std::string& ns);
			void BAnimationManager(lua_State* lua, const std::string& ns);
			void BDirAnimationManager(lua_State* lua, const std::string& ns);
			void BRenderImageManager(lua_State* lua, const std::string& ns);

#define MManager(name) globals(lua)[ns.c_str()][#name"Manager"] = sl:: ## name ## Manager

#define MManagerTemplate(class, name) BSpecific<class>(lua, ns, #name)
#define MManagerPointer(class, name) BPointer<class>(lua, ns, #name)
		}
	}
}

#endif //BIND_SL_MANAGER_HPP